<template>
	<!-- 车辆认证 -->
	<view class="main">
		<!-- 顶部 -->
		<view class="header">
			<uni-notice-bar background-color="rgb(233 243 247)" color="#2979FF" show-icon
				text="信息仅用于驾驶证认证,士德物流保障您的信息安全" />
		</view>

		<!-- 内容中心 -->
		<uni-forms class="from-style" :modelValue="vehicle" ref="form">
			<view class="container">
				<view class="c-zi">

					<uni-section title="车牌号" type="line" titleFontSize="16px">
						<uni-forms-item required>
							<uni-easyinput placeholder="请输入车牌号" v-model="vehicle.liplateNumber" />
						</uni-forms-item>
					</uni-section>
				</view>

				<view class="c-zi">
					<uni-section title="卸车类型" type="line" titleFontSize="16px">
						<uni-forms-item name="unloadingType" required>
							<uni-data-select :v-model="value" :localdata="range" :clear="true"></uni-data-select>
						</uni-forms-item>
					</uni-section>
				</view>

				<view class="c-zi ">
					<uni-section title="请上传行驶证照片" type="line" titleFontSize="16px">
						<view class="liangzhang">
							<uni-forms-item name="xingshizheng">
								<view class="bbb">
									<uni-file-picker file-mediatype="image" limit="1" file-extname="png,jpg"
										:image-styles="imageStyles" :auto-upload="false" @select="uploadface">
										<uni-icons type="plus-filled" size="30" color="blue"></uni-icons>
										<text>上传主页</text>
									</uni-file-picker>
								</view>
							</uni-forms-item>

							<uni-forms-item name="xingshifan">
								<view class="bbb">
									<uni-file-picker file-mediatype="image" limit="1" file-extname="png,jpg"
										:image-styles="imageStyles" :auto-upload="false" @select="uploadback"
										v-model="vehicle.xingshifan">
										<uni-icons type="plus-filled" size="30" color="blue"></uni-icons><br>
										<text>上传副页</text>
									</uni-file-picker>
								</view>
							</uni-forms-item>
						</view>
					</uni-section>
				</view>

				<view class="c-zi">
					<uni-section title="请上传道路运输证照片" titleFontSize="16px" type="line">
						<view class="yizhang">
							<uni-forms-item name="daoluyun">
								<view class="bbb">
									<uni-file-picker file-mediatype="image" limit="1" file-extname="png,jpg"
										:image-styles="imageStyles" :auto-upload="false" @select="uploadTransport"
										v-model="vehicle.daoluyun">
										<uni-icons type="plus-filled" size="30" color="blue"
											style="padding-left: 15px;"></uni-icons><br>
										<text>上传</text>
									</uni-file-picker>
								</view>
							</uni-forms-item>
						</view>
					</uni-section>
				</view>

				<view class="c-zi">
					<uni-section title="请上传道路经营许可证照片" titleFontSize="16px" type="line">
						<view class="yizhang">
							<uni-forms-item name="daoluxuke">
								<view class="bbb">
									<uni-file-picker file-mediatype="image" limit="1" file-extname="png,jpg"
										:image-styles="imageStyles" :auto-upload="false" @select="uploadPermission"
										v-model="vehicle.daoluxuke">
										<uni-icons type="plus-filled" size="30" color="blue"
											style="padding-left: 15px;"></uni-icons><br>
										<text>上传</text>
									</uni-file-picker>
								</view>
							</uni-forms-item>
						</view>
					</uni-section>
				</view>

				<view class="c-zi">
					<uni-section title="请上传购/租车合同照片" type="line" titleFontSize="16px">
						<view class="liangzhang">
							<uni-forms-item name="gouche">
								<view class="bbb">
									<uni-file-picker file-mediatype="image" limit="1" file-extname="png,jpg"
										:image-styles="imageStyles" :auto-upload="false" @select="uploadBuyCar"
										v-model="vehicle.gouche">
										<uni-icons type="plus-filled" size="30" color="blue"></uni-icons>
										<text>上传主页</text>
									</uni-file-picker>
								</view>
							</uni-forms-item>

							<uni-forms-item name="zuche">
								<view class="bbb">
									<uni-file-picker file-mediatype="image" limit="1" file-extname="png,jpg"
										:image-styles="imageStyles" :auto-upload="false" @select="uploadRentCar"
										v-model="vehicle.zuche">
										<uni-icons type="plus-filled" size="30" color="blue"></uni-icons><br>
										<text>上传尾页</text>
									</uni-file-picker>
								</view>
							</uni-forms-item>
						</view>
					</uni-section>
				</view>

				<view class="c-zi">
					<uni-section title="请上传机动车交强保险单照片" titleFontSize="16px" type="line">
						<view class="yizhang">
							<uni-forms-item name="jiaoqiang">
								<view class="bbb">
									<uni-file-picker file-mediatype="image" limit="1" file-extname="png,jpg"
										:image-styles="imageStyles" :auto-upload="false" @select="uploadCompulsory"
										v-model="vehicle.jiaoqiang">
										<uni-icons type="plus-filled" size="30" color="blue"
											style="padding-left: 15px;"></uni-icons><br>
										<text>上传</text>
									</uni-file-picker>
								</view>
							</uni-forms-item>
						</view>
					</uni-section>
				</view>

				<view class="c-zi">
					<uni-section title="请上传人车合照" titleFontSize="16px" type="line">
						<view class="yizhang">
							<uni-forms-item name="renche">
								<view class="bbb">
									<uni-file-picker file-mediatype="image" limit="1" file-extname="png,jpg"
										:image-styles="imageStyles" :auto-upload="false" @select="uploadManCar"
										v-model="vehicle.renche">
										<uni-icons type="plus-filled" size="30" color="blue"
											style="padding-left: 15px;"></uni-icons><br>
										<text>上传</text>
									</uni-file-picker>
								</view>
							</uni-forms-item>
						</view>
					</uni-section>
				</view>
			</view>

			<!-- 底部 -->
			<view class="bottom">
				<button type="primary" class="button-style" @click="xiayibu">下一步</button>
			</view>
		</uni-forms>
	</view>
</template>

<script>
	export default {
		data( ) {
			return {
				value: 1,
				range: [ {
						value: 1,
						text: "自卸",
						// disable: true
					},
					{
						value: 2,
						text: "半自卸",
						disable: true
					},
				],
				vehicle: {},
				imageStyles: {
					width: 185.25,
					height: 115,
				},
				mytupian: {
					xingshizheng: '',
					xingshifan: '',
					daoluyun: '',
					daoluxuke: '',
					gouche: '',
					zuche: '',
					jiaoqiang: '',
					renche: '',
					phone: '17635711209'
				},
				carCard: {},

			}
		},
		methods: {
			onReady( ) {
				// 需要在onReady中设置规则
				this.$refs.form.setRules( this.rules )
			},

			//行驶证正面上传
			uploadface( e ) {
				let that = this;
				let tiemr = new Date( );
				let address = tiemr.getFullYear( ) + '' + ( tiemr.getMonth( ) + 1 ) + '' + tiemr
					.getDate( );
				address = 'zskp/userHead/' + address + '/';
				var tempFilePaths = e.tempFilePaths[ 0 ];
				let str = e.tempFilePaths[ 0 ].substr( e.tempFilePaths[ 0 ].lastIndexOf( '.' ) );
				let nameStr = address + tiemr.getTime( ) + str;
				let ossUrl = 'http://localhost:8099/tsVehicleCertification/getVehicleFace';
				uni.uploadFile( {
					url: ossUrl, //输入你的bucketname.endpoint
					filePath: tempFilePaths,
					fileType: 'image',
					name: 'file',
					formData: {
						name: nameStr,
						key: nameStr,
						policy: 'eyJleHBpcmF0aW9uIjoiMjAyMy0wNi0yNlQwMjoyMjozOS4yMjJaIiwiY29uZGl0aW9ucyI6W1siY29udGVudC1sZW5ndGgtcmFuZ2UiLDAsMTA0ODU3NjAwMF0sWyJzdGFydHMtd2l0aCIsIiRrZXkiLCIyMDIzLTA2LTI2LyJdXX0=', // 输入你获取的的policy
						OSSAccessKeyId: 'LTAI5tJsR6uZnmEUoa4c5hzH', // 输入你的AccessKeyId
						success_action_status: '200', // 让服务端返回200,不然，默认会返回204
						signature: 'isMKvr1Wrwnd1zSpo/cgvCPKSNY=' // 输入你获取的的signature
					},
					success: res => {
						if ( res.statusCode == '200' ) {
							const result = JSON.parse( res.data )
							console.log( result )
							console.log( result.data1 );
							this.vehicle.unloadingType = this.value;
							// this.vehicle.liplateNumber = this.
							this.vehicle.address = result.data1.address;
							this.vehicle.engineNumber = result.data1.engineNumber;
							this.vehicle.issueDate = result.data1.issueDate;
							this.vehicle.model = result.data1.model;
							this.vehicle.owner = result.data1.owner;
							this.vehicle.plateNumber = result.data1.plateNumber;
							this.carCard.plateNumber = result.data1.plateNumber;
							this.vehicle.registerDate = result.data1.registerDate;
							this.vehicle.useCharacter = result.data1.useCharacter;
							this.vehicle.vehicleType = result.data1.vehicleType;
							this.vehicle.vin = result.data1.vin;
							this.vehicle.unloadingType = this.value
							this.carCard.travelCardFront = result.data1.travelCardFront
						} else {
							uni.showToast( {
								title: '上传失败',
								icon: 'none',
								duration: 1000
							} )
						}
					}
				} )
			},

			//行驶证反面上传
			uploadback( e ) {
				let that = this;
				let tiemr = new Date( );
				let address = tiemr.getFullYear( ) + '' + ( tiemr.getMonth( ) + 1 ) + '' + tiemr
					.getDate( );
				address = 'zskp/userHead/' + address + '/';
				var tempFilePaths = e.tempFilePaths[ 0 ];
				let str = e.tempFilePaths[ 0 ].substr( e.tempFilePaths[ 0 ].lastIndexOf( '.' ) );
				let nameStr = address + tiemr.getTime( ) + str;
				let ossUrl = 'http://localhost:8099/tsVehicleCertification/getVehicleBack';
				uni.uploadFile( {
					url: ossUrl, //输入你的bucketname.endpoint
					filePath: tempFilePaths,
					fileType: 'image',
					name: 'file',
					formData: {
						name: nameStr,
						key: nameStr,
						policy: 'eyJleHBpcmF0aW9uIjoiMjAyMy0wNi0yNlQwMjoyMjozOS4yMjJaIiwiY29uZGl0aW9ucyI6W1siY29udGVudC1sZW5ndGgtcmFuZ2UiLDAsMTA0ODU3NjAwMF0sWyJzdGFydHMtd2l0aCIsIiRrZXkiLCIyMDIzLTA2LTI2LyJdXX0=', // 输入你获取的的policy
						OSSAccessKeyId: 'LTAI5tJsR6uZnmEUoa4c5hzH', // 输入你的AccessKeyId
						success_action_status: '200', // 让服务端返回200,不然，默认会返回204
						signature: 'isMKvr1Wrwnd1zSpo/cgvCPKSNY=' // 输入你获取的的signature
					},
					success: res => {
						if ( res.statusCode == '200' ) {
							const result = JSON.parse( res.data )
							console.log( result.data1 );
							this.vehicle.approvedPassengerCapacity = result.data1.approvedPassengerCapacity;
							this.vehicle.grossMass = result.data1.grossMass;
							this.vehicle.inspectionRecord = result.data1.inspectionRecord;
							this.vehicle.overallDimension = result.data1.overallDimension;
							this.vehicle.unladenMass = result.data1.unladenMass;
							this.vehicle.approvedLoad = result.data1.approvedLoad;
							this.vehicle.energyType = result.data1.energyType;
							this.vehicle.fileNumber = result.data1.fileNumber;
							this.vehicle.tractionMass = result.data1.tractionMass;
							this.carCard.travelCardOpposite = result.data1.travelCardOpposite
						} else {
							uni.showToast( {
								title: '上传失败',
								icon: 'none',
								duration: 1000
							} )
						}
					}
				} )
			},

			//道路运输上传
			uploadTransport( e ) {
				let that = this;
				let tiemr = new Date( );
				let address = tiemr.getFullYear( ) + '' + ( tiemr.getMonth( ) + 1 ) + '' + tiemr
					.getDate( );
				address = 'zskp/userHead/' + address + '/';
				var tempFilePaths = e.tempFilePaths[ 0 ];
				let str = e.tempFilePaths[ 0 ].substr( e.tempFilePaths[ 0 ].lastIndexOf( '.' ) );
				let nameStr = address + tiemr.getTime( ) + str;
				let ossUrl = 'http://localhost:8099/tsVehicleCertification/getTransport';
				uni.uploadFile( {
					url: ossUrl, //输入你的bucketname.endpoint
					filePath: tempFilePaths,
					fileType: 'image',
					name: 'file',
					formData: {
						name: nameStr,
						key: nameStr,
						policy: 'eyJleHBpcmF0aW9uIjoiMjAyMy0wNi0yNlQwMjoyMjozOS4yMjJaIiwiY29uZGl0aW9ucyI6W1siY29udGVudC1sZW5ndGgtcmFuZ2UiLDAsMTA0ODU3NjAwMF0sWyJzdGFydHMtd2l0aCIsIiRrZXkiLCIyMDIzLTA2LTI2LyJdXX0=', // 输入你获取的的policy
						OSSAccessKeyId: 'LTAI5tJsR6uZnmEUoa4c5hzH', // 输入你的AccessKeyId
						success_action_status: '200', // 让服务端返回200,不然，默认会返回204
						signature: 'isMKvr1Wrwnd1zSpo/cgvCPKSNY=' // 输入你获取的的signature
					},
					success: res => {
						if ( res.statusCode == '200' ) {
							const result = JSON.parse( res.data )
							console.log( result )
							console.log( result.data1 );
							this.carCard.transportCertificate = result.data1
						} else {
							uni.showToast( {
								title: '上传失败',
								icon: 'none',
								duration: 1000
							} )
						}
					}
				} )
			},

			//道路许可上传
			uploadPermission( e ) {
				let that = this;
				let tiemr = new Date( );
				let address = tiemr.getFullYear( ) + '' + ( tiemr.getMonth( ) + 1 ) + '' + tiemr
					.getDate( );
				address = 'zskp/userHead/' + address + '/';
				var tempFilePaths = e.tempFilePaths[ 0 ];
				let str = e.tempFilePaths[ 0 ].substr( e.tempFilePaths[ 0 ].lastIndexOf( '.' ) );
				let nameStr = address + tiemr.getTime( ) + str;
				let ossUrl = 'http://localhost:8099/tsVehicleCertification/getPermission';
				uni.uploadFile( {
					url: ossUrl, //输入你的bucketname.endpoint
					filePath: tempFilePaths,
					fileType: 'image',
					name: 'file',
					formData: {
						name: nameStr,
						key: nameStr,
						policy: 'eyJleHBpcmF0aW9uIjoiMjAyMy0wNi0yNlQwMjoyMjozOS4yMjJaIiwiY29uZGl0aW9ucyI6W1siY29udGVudC1sZW5ndGgtcmFuZ2UiLDAsMTA0ODU3NjAwMF0sWyJzdGFydHMtd2l0aCIsIiRrZXkiLCIyMDIzLTA2LTI2LyJdXX0=', // 输入你获取的的policy
						OSSAccessKeyId: 'LTAI5tJsR6uZnmEUoa4c5hzH', // 输入你的AccessKeyId
						success_action_status: '200', // 让服务端返回200,不然，默认会返回204
						signature: 'isMKvr1Wrwnd1zSpo/cgvCPKSNY=' // 输入你获取的的signature
					},
					success: res => {
						if ( res.statusCode == '200' ) {
							const result = JSON.parse( res.data )
							console.log( result )
							console.log( result.data1 );
							this.carCard.transportationBusinessLicense = result.data1
						} else {
							uni.showToast( {
								title: '上传失败',
								icon: 'none',
								duration: 1000
							} )
						}
					}
				} )
			},

			//购车合同上传
			uploadBuyCar( e ) {
				let that = this;
				let tiemr = new Date( );
				let address = tiemr.getFullYear( ) + '' + ( tiemr.getMonth( ) + 1 ) + '' + tiemr
					.getDate( );
				address = 'zskp/userHead/' + address + '/';
				var tempFilePaths = e.tempFilePaths[ 0 ];
				let str = e.tempFilePaths[ 0 ].substr( e.tempFilePaths[ 0 ].lastIndexOf( '.' ) );
				let nameStr = address + tiemr.getTime( ) + str;
				let ossUrl = 'http://localhost:8099/tsVehicleCertification/getBuyCar';
				uni.uploadFile( {
					url: ossUrl, //输入你的bucketname.endpoint
					filePath: tempFilePaths,
					fileType: 'image',
					name: 'file',
					formData: {
						name: nameStr,
						key: nameStr,
						policy: 'eyJleHBpcmF0aW9uIjoiMjAyMy0wNi0yNlQwMjoyMjozOS4yMjJaIiwiY29uZGl0aW9ucyI6W1siY29udGVudC1sZW5ndGgtcmFuZ2UiLDAsMTA0ODU3NjAwMF0sWyJzdGFydHMtd2l0aCIsIiRrZXkiLCIyMDIzLTA2LTI2LyJdXX0=', // 输入你获取的的policy
						OSSAccessKeyId: 'LTAI5tJsR6uZnmEUoa4c5hzH', // 输入你的AccessKeyId
						success_action_status: '200', // 让服务端返回200,不然，默认会返回204
						signature: 'isMKvr1Wrwnd1zSpo/cgvCPKSNY=' // 输入你获取的的signature
					},
					success: res => {
						if ( res.statusCode == '200' ) {
							const result = JSON.parse( res.data )
							console.log( result )
							console.log( result.data1 );
							this.carCard.carPurchaseContractFirst = result.data1
						} else {
							uni.showToast( {
								title: '上传失败',
								icon: 'none',
								duration: 1000
							} )
						}
					}
				} )
			},

			//租车合同上传
			uploadRentCar( e ) {
				let that = this;
				let tiemr = new Date( );
				let address = tiemr.getFullYear( ) + '' + ( tiemr.getMonth( ) + 1 ) + '' + tiemr
					.getDate( );
				address = 'zskp/userHead/' + address + '/';
				var tempFilePaths = e.tempFilePaths[ 0 ];
				let str = e.tempFilePaths[ 0 ].substr( e.tempFilePaths[ 0 ].lastIndexOf( '.' ) );
				let nameStr = address + tiemr.getTime( ) + str;
				let ossUrl = 'http://localhost:8099/tsVehicleCertification/getRentCar';
				uni.uploadFile( {
					url: ossUrl, //输入你的bucketname.endpoint
					filePath: tempFilePaths,
					fileType: 'image',
					name: 'file',
					formData: {
						name: nameStr,
						key: nameStr,
						policy: 'eyJleHBpcmF0aW9uIjoiMjAyMy0wNi0yNlQwMjoyMjozOS4yMjJaIiwiY29uZGl0aW9ucyI6W1siY29udGVudC1sZW5ndGgtcmFuZ2UiLDAsMTA0ODU3NjAwMF0sWyJzdGFydHMtd2l0aCIsIiRrZXkiLCIyMDIzLTA2LTI2LyJdXX0=', // 输入你获取的的policy
						OSSAccessKeyId: 'LTAI5tJsR6uZnmEUoa4c5hzH', // 输入你的AccessKeyId
						success_action_status: '200', // 让服务端返回200,不然，默认会返回204
						signature: 'isMKvr1Wrwnd1zSpo/cgvCPKSNY=' // 输入你获取的的signature
					},
					success: res => {
						if ( res.statusCode == '200' ) {
							const result = JSON.parse( res.data )
							console.log( result )
							console.log( result.data1 );
							this.carCard.carPurchaseContractEnd = result.data1
						} else {
							uni.showToast( {
								title: '上传失败',
								icon: 'none',
								duration: 1000
							} )
						}
					}
				} )
			},

			//交强险上传
			uploadCompulsory( e ) {
				let that = this;
				let tiemr = new Date( );
				let address = tiemr.getFullYear( ) + '' + ( tiemr.getMonth( ) + 1 ) + '' + tiemr
					.getDate( );
				address = 'zskp/userHead/' + address + '/';
				var tempFilePaths = e.tempFilePaths[ 0 ];
				let str = e.tempFilePaths[ 0 ].substr( e.tempFilePaths[ 0 ].lastIndexOf( '.' ) );
				let nameStr = address + tiemr.getTime( ) + str;
				let ossUrl = 'http://localhost:8099/tsVehicleCertification/getCompulsory';
				uni.uploadFile( {
					url: ossUrl, //输入你的bucketname.endpoint
					filePath: tempFilePaths,
					fileType: 'image',
					name: 'file',
					formData: {
						name: nameStr,
						key: nameStr,
						policy: 'eyJleHBpcmF0aW9uIjoiMjAyMy0wNi0yNlQwMjoyMjozOS4yMjJaIiwiY29uZGl0aW9ucyI6W1siY29udGVudC1sZW5ndGgtcmFuZ2UiLDAsMTA0ODU3NjAwMF0sWyJzdGFydHMtd2l0aCIsIiRrZXkiLCIyMDIzLTA2LTI2LyJdXX0=', // 输入你获取的的policy
						OSSAccessKeyId: 'LTAI5tJsR6uZnmEUoa4c5hzH', // 输入你的AccessKeyId
						success_action_status: '200', // 让服务端返回200,不然，默认会返回204
						signature: 'isMKvr1Wrwnd1zSpo/cgvCPKSNY=' // 输入你获取的的signature
					},
					success: res => {
						if ( res.statusCode == '200' ) {
							const result = JSON.parse( res.data )
							console.log( result )
							console.log( result.data1 );
							this.carCard.motorVehicleCompulsoryInsurance = result.data1
						} else {
							uni.showToast( {
								title: '上传失败',
								icon: 'none',
								duration: 1000
							} )
						}
					}
				} )
			},

			//人车合照上传
			uploadManCar( e ) {
				let that = this;
				let tiemr = new Date( );
				let address = tiemr.getFullYear( ) + '' + ( tiemr.getMonth( ) + 1 ) + '' + tiemr
					.getDate( );
				address = 'zskp/userHead/' + address + '/';
				var tempFilePaths = e.tempFilePaths[ 0 ];
				let str = e.tempFilePaths[ 0 ].substr( e.tempFilePaths[ 0 ].lastIndexOf( '.' ) );
				let nameStr = address + tiemr.getTime( ) + str;
				let ossUrl = 'http://localhost:8099/tsVehicleCertification/getManCar';
				uni.uploadFile( {
					url: ossUrl, //输入你的bucketname.endpoint
					filePath: tempFilePaths,
					fileType: 'image',
					name: 'file',
					formData: {
						name: nameStr,
						key: nameStr,
						policy: 'eyJleHBpcmF0aW9uIjoiMjAyMy0wNi0yNlQwMjoyMjozOS4yMjJaIiwiY29uZGl0aW9ucyI6W1siY29udGVudC1sZW5ndGgtcmFuZ2UiLDAsMTA0ODU3NjAwMF0sWyJzdGFydHMtd2l0aCIsIiRrZXkiLCIyMDIzLTA2LTI2LyJdXX0=', // 输入你获取的的policy
						OSSAccessKeyId: 'LTAI5tJsR6uZnmEUoa4c5hzH', // 输入你的AccessKeyId
						success_action_status: '200', // 让服务端返回200,不然，默认会返回204
						signature: 'isMKvr1Wrwnd1zSpo/cgvCPKSNY=' // 输入你获取的的signature
					},
					success: res => {
						if ( res.statusCode == '200' ) {
							const result = JSON.parse( res.data )
							console.log( result )
							console.log( result.data1 );
							this.carCard.groupPhoto = result.data1
						} else {
							uni.showToast( {
								title: '上传失败',
								icon: 'none',
								duration: 1000
							} )
						}
					}
				} )
			},

			//下一步,将车辆认证信息传递给后端
			async xiayibu( form ) {
				this.addVehicle( );

			},
			
			// 添加carCard信息
			async addCarCard( ) {
				const result1 = await uni.$http.post( "localhost:8099/tsCarCard/insertCarCard",
					this.carCard );
				console.log( this.carCard )
				const {
					data1,
					code1
				} = result1.data
				if ( code1 == 0 ) {
					console.log( "添加成功" )
				} else if ( code1 == 1 ) {
					uni.showToast( {
						title: "信息填写错误，请检查填写信息",
						icon: 'error',
						duration: 1000
					} );
				}
			},
			
			// 添加车辆认证信息
			async addVehicle( ) {
				const result = await uni.$http.post( "localhost:8099/tsVehicleCertification/insertVehicle",
					this.vehicle );
				console.log( this.vehicle )
				const {
					data,
					code
				} = result.data
				if ( code == 0 ) {
					uni.showToast( {
						title: "车辆认证成功，即将返回个人中心",
						icon: 'success',
						duration: 1000
					} );
					this.addCarCard( );
					uni.switchTab({
						url: '/pages/mine/mine'
					});
				} else if ( code == 101 ) {
					uni.showToast( {
						title: "信息填写错误，请检查填写信息",
						icon: 'error',
						duration: 1000
					} );
				} else if ( code == 102 ) {
					uni.showToast( {
						title: "车牌号与行驶证记录车牌号不一致，请检查后再次提交",
						icon: 'error',
						duration: 1000
					} );
				} else if ( code == 103 ) {
					uni.showToast( {
						title: "车辆信息已注册，请重新填写认证信息",
						icon: 'error',
						duration: 1000
					} );
				}
			}
		}

	}
</script>

<style>
	/* 最大容器 */
	.main {
		display: flex;
		flex-direction: column;
		width: 100%;
		height: 100%;
		background-color: Snow;
	}

	/* 头部容器 */
	.header {
		width: 100%;
		height: 100rpx;
		margin-bottom: -10px;
	}

	/* 中间容器 */
	.container {
		display: flex;
		flex-flow: column nowrap;
		justify-content: flex-start;
		align-content: space-evenly;
		width: 100%;
		height: 686px;
		overflow-y: scroll;
	}

	.c-zi {
		width: 95%;
		/* flex: 1; */
		margin: 0px auto;
		margin-bottom: -22px;
	}

	.yizhang {
		display: flex;
		width: 50%;
		height: 120px;
		margin: 0 5px;
		/* flex-flow: column wrap;
		justify-content: center;
		align-items: center; */

	}

	.liangzhang {
		display: flex;
		width: 100%;
		height: 120px;
		justify-content: space-evenly;
	}

	/* 底部容器 */
	.bottom {
		width: 100%;
		height: 120rpx;
		display: flex;
		justify-content: center;
		align-items: center;
	}

	/* 下一步按钮样式 */
	.button-style {
		margin: 0 auto;
		width: 80%;
		border-radius: 35px;
	}

	.aaa {
		display: flex;
		width: 100%;
		height: 100%;
		justify-content: center;
		align-items: center;
		background-color: whitesmoke;
		/* padding: 10px;
		margin: 0 5px; */
	}

	.bbb {
		display: flex;
		flex-flow: column nowrap;
		justify-content: center;
		align-items: center;
		background-color: whitesmoke;
	}
</style>